sgml fixes
authorHavoc Pennington <hp@pobox.com>
Sat, 12 Jan 2002 04:39:07 +0000 (04:39 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Sat, 12 Jan 2002 04:39:07 +0000 (04:39 +0000)
2002-01-11  Havoc Pennington  <hp@pobox.com>

* gtk/running.sgml: sgml fixes

* gtk/tmpl/gtksignal.sgml: sgml fixes

* gtk/tmpl/gtklabel.sgml: do the intro section

2002-01-11  Havoc Pennington  <hp@pobox.com>

* gtk/gtklabel.c: put in more links to Pango markup format docs
(gtk_label_set_justify): mention gtk_misc_set_alignment

16 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/reference/ChangeLog
docs/reference/gtk/running.sgml
docs/reference/gtk/tmpl/gtk-unused.sgml
docs/reference/gtk/tmpl/gtkaccellabel.sgml
docs/reference/gtk/tmpl/gtklabel.sgml
docs/reference/gtk/tmpl/gtkpaned.sgml
docs/reference/gtk/tmpl/gtksignal.sgml
docs/reference/gtk/tmpl/gtkwidget.sgml
gtk/gtklabel.c

index 9d472601d5547ed3bed91abb8ae77602df4aa5aa..a85eccb1256ae4fdc5a37320a75cb74d34879696 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-01-11  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtklabel.c: put in more links to Pango markup format docs
+       (gtk_label_set_justify): mention gtk_misc_set_alignment
+
 2002-01-12  Tor Lillqvist  <tml@iki.fi>
 
        Fixes contributed by Archaeopteryx Software: This is a first small
index 9d472601d5547ed3bed91abb8ae77602df4aa5aa..a85eccb1256ae4fdc5a37320a75cb74d34879696 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-11  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtklabel.c: put in more links to Pango markup format docs
+       (gtk_label_set_justify): mention gtk_misc_set_alignment
+
 2002-01-12  Tor Lillqvist  <tml@iki.fi>
 
        Fixes contributed by Archaeopteryx Software: This is a first small
index 9d472601d5547ed3bed91abb8ae77602df4aa5aa..a85eccb1256ae4fdc5a37320a75cb74d34879696 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-11  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtklabel.c: put in more links to Pango markup format docs
+       (gtk_label_set_justify): mention gtk_misc_set_alignment
+
 2002-01-12  Tor Lillqvist  <tml@iki.fi>
 
        Fixes contributed by Archaeopteryx Software: This is a first small
index 9d472601d5547ed3bed91abb8ae77602df4aa5aa..a85eccb1256ae4fdc5a37320a75cb74d34879696 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-11  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtklabel.c: put in more links to Pango markup format docs
+       (gtk_label_set_justify): mention gtk_misc_set_alignment
+
 2002-01-12  Tor Lillqvist  <tml@iki.fi>
 
        Fixes contributed by Archaeopteryx Software: This is a first small
index 9d472601d5547ed3bed91abb8ae77602df4aa5aa..a85eccb1256ae4fdc5a37320a75cb74d34879696 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-11  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtklabel.c: put in more links to Pango markup format docs
+       (gtk_label_set_justify): mention gtk_misc_set_alignment
+
 2002-01-12  Tor Lillqvist  <tml@iki.fi>
 
        Fixes contributed by Archaeopteryx Software: This is a first small
index 9d472601d5547ed3bed91abb8ae77602df4aa5aa..a85eccb1256ae4fdc5a37320a75cb74d34879696 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-11  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtklabel.c: put in more links to Pango markup format docs
+       (gtk_label_set_justify): mention gtk_misc_set_alignment
+
 2002-01-12  Tor Lillqvist  <tml@iki.fi>
 
        Fixes contributed by Archaeopteryx Software: This is a first small
index 9d472601d5547ed3bed91abb8ae77602df4aa5aa..a85eccb1256ae4fdc5a37320a75cb74d34879696 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-11  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtklabel.c: put in more links to Pango markup format docs
+       (gtk_label_set_justify): mention gtk_misc_set_alignment
+
 2002-01-12  Tor Lillqvist  <tml@iki.fi>
 
        Fixes contributed by Archaeopteryx Software: This is a first small
index 838711553dd0e52a20d5318fcd178a1c9e100832..7210bd30876a8cc02b90fd66a8fb1510376b5974 100644 (file)
@@ -1,3 +1,11 @@
+2002-01-11  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/running.sgml: sgml fixes
+
+       * gtk/tmpl/gtksignal.sgml: sgml fixes
+
+       * gtk/tmpl/gtklabel.sgml: do the intro section
+
 2002-01-09  Matthias Clasen  <matthiasc@poet.de>
 
        * gtk/tmpl/gtkaccellabel.sgml: Remove duplicate docs.
index 5cdf669b596da356357c1de79f49f36db63f32e0..a73f7754305b694f005e6311b121afb2afdd6511 100644 (file)
@@ -20,8 +20,9 @@ How to run and debug your GTK+ application
 
 <para>
 All GTK+ applications support a number of standard commandline
-options. These are removed from <literal>argv</literal> by 
-gtk_init(). Modules may parse and remove further options.
+options. These are removed from <literal>argv</literal> by <link
+linkend="gtk-init">gtk_init()</link>. Modules may parse and remove
+further options.
 </para>
 
 <formalpara>
@@ -37,7 +38,10 @@ A list of modules to load in addition to those specified in the
 <title><systemitem>--g-fatal-warnings</systemitem></title>
 
 <para>
-Make GTK+ abort on all warnings.
+Make GTK+ abort on all warnings. This is useful to stop on the first
+warning in a debugger, if your application is printing multiple
+warnings.  It's almost always best to start debugging with the first
+warning that occurs.
 </para>
 </formalpara>
 
@@ -188,7 +192,7 @@ or <envar>DISPLAY</envar>; mostly to determine paths to look for certain files.
       <listitem><para>Visual feedback about window updates</para></listitem>
     </varlistentry>
   </variablelist>
-  The special value <term>all</term> can be used to turn on all debug options.
+  The special value <literal>all</literal> can be used to turn on all debug options.
   </para>
 </formalpara>
 
@@ -209,7 +213,7 @@ or <envar>DISPLAY</envar>; mostly to determine paths to look for certain files.
     (If <envar>GTK_EXE_PREFIX</envar> is defined, &lt;libdir&gt; is 
     <filename>$GTK_EXE_PREFIX/lib</filename>. Otherwise it is the libdir
     specified when GTK+ was configured, usually 
-    <filename>/usr/local/lib</libdir>.) 
+    <filename>/usr/local/lib</filename>.) 
     For each directory in the list, GTK+ actually looks first in 
     a subdirectory named after the version number of GTK+, then in the 
     directory itself and finally in the system-specific library path.
@@ -247,9 +251,9 @@ or <envar>DISPLAY</envar>; mostly to determine paths to look for certain files.
     the RC files, which in turn overwrites the default value 
     <filename>&lt;sysconfdir&gt;/gtk-2.0/gtk.immodules</filename>
     (&lt;sysconfdir&gt; is the sysconfdir specified when GTK+ was configured, 
-     usually <filename>/usr/local/etc</libdir>.)
+     usually <filename>/usr/local/etc</filename>.)
   </para>
-<formalpara>
+</formalpara>
 
 <formalpara>
   <title><envar>GTK_RC_FILES</envar></title>
@@ -257,6 +261,7 @@ or <envar>DISPLAY</envar>; mostly to determine paths to look for certain files.
   <para>
     Specifies a list of RC files to parse instead of the default ones;
     see <link linkend="gtk-Resource-Files">Resource Files</link>.
+  </para>
 </formalpara>
 
 <formalpara>
@@ -272,7 +277,7 @@ or <envar>DISPLAY</envar>; mostly to determine paths to look for certain files.
   <title><envar>GTK_DATA_PREFIX</envar></title>
 
   <para>
-    If set, makes GTK+ use <filename>$GTK_DATA_PREFIX<filename>
+    If set, makes GTK+ use <filename>$GTK_DATA_PREFIX</filename>
     instead of the prefix configured when GTK+ was compiled.
   </para>
 </formalpara>
@@ -318,7 +323,7 @@ nevertheless.
       <listitem><para>Information about XIM support</para></listitem>
     </varlistentry>
   </variablelist>
-  The special value <term>all</term> can be used to turn on all debug options.
+  The special value <literal>all</literal> can be used to turn on all debug options.
   </para>
 </formalpara>
 
index 456bfeb3dd353c1fdcfcf395ed25471f456a531e..a3bb8b493ed9cfbd908df043ccbca0c233eb8c6e 100644 (file)
@@ -2550,12 +2550,6 @@ Internal function used by #GtkHPaned and #GtkVPaned
 @child1_req: 
 @child2_req: 
 
-<!-- ##### MACRO gtk_paned_handle_size ##### -->
-<para>
-Old name for gtk_paned_set_handle_size().
-</para>
-
-
 <!-- ##### FUNCTION gtk_paned_set_handle_size ##### -->
 <para>
 Set the the handle size to @size x @size pixels.
index 27460fd6e383253e21ba584c42c13ba3d19d8524..a7810029316467ca8de39ce756ec3cd5310f0bd2 100644 (file)
@@ -118,7 +118,7 @@ Creates a new #GtkAccelLabel.
 </para>
 
 @accel_label: 
-@accel_widget:
+@accel_widget: 
 
 
 <!-- ##### FUNCTION gtk_accel_label_get_accel_width ##### -->
index b3e18791f606186be1406c983c41b6b72781db81..707e7d4fc24be45ddfc2bf2222fe61466083888a 100644 (file)
@@ -6,11 +6,132 @@ A widget that displays a small to medium amount of text.
 
 <!-- ##### SECTION Long_Description ##### -->
 <para>
-The #GtkLabel widget is usually used directly by the programmer to display
-word(s) describing an adjacent widget or its use.  It is also used internally
-by Gtk+ as #GtkButton labels, #GtkMenu items, and many other widgets which
-use text.
+The #GtkLabel widget displays a small amount of text. As the name
+implies, most labels are used to label another widget such as a
+#GtkButton, a #GtkMenuItem, or a #GtkOptionMenu.
+</para>
+
+<refsect2>
+<title>Mnemonics</title>
+
+<para>
+Labels may contain <firstterm>mnemonics</firstterm>. Mnemonics are
+underlined characters in the label, used for keyboard navigation.
+Mnemonics are created by providing a string with an underscore before
+the mnemonic character, such as <literal>"_File"</literal>, to the
+functions gtk_label_new_with_mnemonic() or
+gtk_label_set_text_with_mnemonic().
+</para>
+
+<para>
+Mnemonics automatically activate any activatable widget the label is
+inside, such as a #GtkButton; if the label is not inside the
+mnemonic's target widget, you have to tell the label about the target
+using gtk_label_set_mnemonic_widget(). Here's a simple example where
+the label is inside a button:
+
+<informalexample>
+<programlisting>
+  /* Pressing Alt+H will activate this button */
+  button = gtk_button_new ();
+  label = gtk_label_new_with_mnemonic ("_Hello");
+  gtk_container_add (GTK_CONTAINER (button), label);
+</programlisting>
+</informalexample>
+There's a convenience function to create buttons with a mnemonic label 
+already inside:
+
+<informalexample>
+<programlisting>
+  /* Pressing Alt+H will activate this button */
+  button = gtk_button_new_with_mnemonic ("_Hello");
+</programlisting>
+</informalexample>
+
+To create a mnemonic for a widget alongside the label, such as a 
+#GtkEntry, you have to point the label at the entry with 
+gtk_label_set_mnemonic_widget():
+<informalexample>
+<programlisting>
+  /* Pressing Alt+H will focus the entry */
+  entry = gtk_entry_new ();
+  label = gtk_label_new_with_mnemonic ("_Hello");
+  gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
+</programlisting>
+</informalexample>
+
+</para>
+
+</refsect2>
+
+<refsect2>
+<title>Markup (styled text)</title>
+
+<para>
+To make it easy to format text in a label (changing colors, fonts,
+etc.), label text can be provided in a simple <link
+linkend="PangoMarkupFormat">markup format</link>.
+Here's how to create a label with a small font:
+<informalexample>
+<programlisting>
+  label = gtk_label_new (NULL);
+  gtk_label_set_markup (GTK_LABEL (label), "&lt;small&gt;Small text&lt;/small&gt;");
+</programlisting>
+</informalexample>
+(See <link
+linkend="PangoMarkupFormat">complete documentation</link> of available
+tags in the Pango manual.)
+</para>
+<para>
+The markup passed to gtk_label_set_markup() must be valid; for
+example, literal &lt;/&gt;/&amp; characters must be escaped as 
+&amp;lt;, &amp;gt;, and &amp;amp;. If you pass text obtained from 
+the user, file, or a network to gtk_label_set_markup(), 
+you'll want to escape it with g_markup_escape_text().
 </para>
+<para>
+Markup strings are just a convenient way to set the #PangoAttrList on
+a label; gtk_label_set_attributes() may be a simpler way to set
+attributes in some cases. Be careful though; #PangoAttrList tends to
+cause internationalization problems, unless you're applying attributes
+to the entire string (i.e. unless you set the range of each attribute
+to [0, G_MAXINT)). The reason is that specifying the start_index and
+end_index for a #PangoAttribute requires knowledge of the exact string
+being displayed, so translations will cause problems.
+</para>
+</refsect2>
+
+<refsect2>
+<title>Selectable labels</title>
+
+<para>
+Labels can be made selectable with gtk_label_set_selectable(). 
+Selectable labels allow the user to copy the label contents to 
+the clipboard. Only labels that contain useful-to-copy information
+&mdash; such as error messages &mdash; should be made selectable.
+</para>
+</refsect2>
+
+<refsect2>
+<title>Text layout</title>
+
+<para>
+A label can contain any number of paragraphs, but will have
+performance problems if it contains more than a small number.
+Paragraphs are separated by newlines or other paragraph separators
+understood by Pango.
+</para>
+<para>
+Labels can automatically wrap text if you call
+gtk_label_set_line_wrap().
+</para>
+<para>
+gtk_label_set_justify() sets how the lines in a label align 
+with one another. If you want to set how the label as a whole 
+aligns in its available space, see gtk_misc_set_alignment().
+</para>
+
+</refsect2>
 
 <!-- ##### SECTION See_Also ##### -->
 <para>
index 1e3b1df6b8c8ec0c96089ab436ac6c3f711913c9..33f24283a36fe8945384778d815aef8365098b32 100644 (file)
@@ -95,6 +95,13 @@ parameters. This is equivalent to
 @child: the child to add
 
 
+<!-- ##### MACRO gtk_paned_handle_size ##### -->
+<para>
+Old name for gtk_paned_set_handle_size().
+</para>
+
+
+
 <!-- ##### MACRO gtk_paned_gutter_size ##### -->
 <para>
 Old name for gtk_paned_set_gutter_size().
index 827568577f9b80a165a9b22f89d1767b15a9c6a5..ec510317dc262005ec3fddde16c07603f4093a3d 100644 (file)
@@ -7,7 +7,7 @@ Object methods and callbacks.
 <!-- ##### SECTION Long_Description ##### -->
 <para>
 The GTK+ signal system merely proxies the GLib signal system now. For future 
-usage, direct use of the <link linkend="gobject-Signals">GSignal</linkend> API is recommended, this avoids significant 
+usage, direct use of the <link linkend="gobject-Signals">GSignal</link> API is recommended, this avoids significant 
 performance hits where #GtkArg structures have to be converted into #GValue<!>s.
 </para>
 
index 736f57129453367c762b496eb26932e77ff61513..8b7e56523f335329eef6837b066aa3a76638cc0a 100644 (file)
@@ -76,8 +76,8 @@ Tells about certain properties of the widget.
 @GTK_COMPOSITE_CHILD: 
         Indicates that the widget is a composite child of its parent; see 
         gtk_widget_push_composite_child(), gtk_widget_pop_composite_child().
-@GTK_NO_REPARENT:
-       Unused since before GTK+ 1.2, will be removed in a future version. 
+@GTK_NO_REPARENT: 
+       Unused since before GTK+ 1.2, will be removed in a future version.
 @GTK_APP_PAINTABLE: 
         Set and unset by gtk_widget_set_app_paintable().
         Must be set on widgets whose window the application directly draws on, 
index 96f0899a87f79a20bc433af2be0287ecd4819ded..9940f0d8fd02cb08e82f9d168dc5e56ac8ff785b 100644 (file)
@@ -1054,7 +1054,7 @@ set_markup (GtkLabel    *label,
  * @label: a #GtkLabel
  * @str: a markup string (see <link linkend="PangoMarkupFormat">Pango markup format</link>)
  * 
- * Parses @str which is marked up with the Pango text markup language,
+ * Parses @str which is marked up with the <link linkend="PangoMarkupFormat">Pango text markup language</link>,
  * setting the label's text and attribute list based on the parse results.
  **/
 void
@@ -1075,7 +1075,7 @@ gtk_label_set_markup (GtkLabel    *label,
  * @label: a #GtkLabel
  * @str: a markup string (see <link linkend="PangoMarkupFormat">Pango markup format</link>)
  * 
- * Parses @str which is marked up with the Pango text markup language,
+ * Parses @str which is marked up with the <link linkend="PangoMarkupFormat">Pango text markup language</link>,
  * setting the label's text and attribute list based on the parse results.
  * If characters in @str are preceded by an underscore, they are underlined
  * indicating that they represent a keyboard accelerator called a mnemonic.
@@ -1192,7 +1192,10 @@ gtk_label_set_pattern (GtkLabel     *label,
  *
  * Sets the alignment of the lines in the text of the label relative to
  * each other.  %GTK_JUSTIFY_LEFT is the default value when the
- * widget is first created with gtk_label_new().
+ * widget is first created with gtk_label_new(). If you instead want
+ * to set the alignment of the label as a whole, use
+ * gtk_misc_set_alignment() instead. gtk_label_set_justify() has no
+ * effect on labels containing only a single line.
  **/
 void
 gtk_label_set_justify (GtkLabel        *label,
@@ -2640,8 +2643,9 @@ gtk_label_get_layout_offsets (GtkLabel *label,
  * @label: a #GtkLabel
  * @setting: %TRUE if the label's text should be parsed for markup.
  *
- * Sets whether the text of the label contains markup in Pango's
- * text markup lango. See gtk_label_set_markup().
+ * Sets whether the text of the label contains markup in <link
+ * linkend="PangoMarkupFormat">Pango's text markup
+ * language</link>. See gtk_label_set_markup().
  **/
 void
 gtk_label_set_use_markup (GtkLabel *label,
@@ -2657,8 +2661,9 @@ gtk_label_set_use_markup (GtkLabel *label,
  * gtk_label_get_use_markup:
  * @label: a #GtkLabel
  *
- * Returns whether the label's text is interpreted as marked up with the
- * Pango text markup language. See gtk_label_set_use_markup ().
+ * Returns whether the label's text is interpreted as marked up with
+ * the <link linkend="PangoMarkupFormat">Pango text markup
+ * language</link>. See gtk_label_set_use_markup ().
  *
  * Return value: %TRUE if the label's text will be parsed for markup.
  **/